trying to fix a null pointer exception