fixed null exceptions