Fixing model reference error