fixed NullPointerException (hopefully)