fixed nullpointers