Fixed what I believe to be a null pointer exception