fixed null if statement violations