fixed null point errors