Remove null pointer exception