got rid of null pointer exception