fixed nil value issue