Solved null pointer exception