Fixed invalid reference error