Fixed null object error