fixed some NullPointers