trying to fix null pointer exception