fix converting models to json