fixed NullPointerException in createSession