Fixed null pointer crash