fixed nullpointer that prevented game closing