fixed a NullPointerException in a really lame way