Corrected null pointer exception

Now it has an illegal state exception. Blah