Fixed null value bug