removing null pointer exception