Fixed null reference crash