bug fix when returning null