Fixed null pointer exception.