fixed null pointer crash