Fixed possible reference error