Add support for shema version 4