Fixed a nullPointerException I encountered