nil values are getting in here