Fixed null pointer Exception