null pointer issue fixed for review