fixed bug - reference error