fixed nullpointer bug.. i think