Fixed bug - undefined object