attempting to fix null pointer exception