fixed nullPointers