Trying to fix null pointer exception.