fixed null pointer exception