Resolved null pointer exception