nil class bug resolved