Fixed null check