fix to read/write sessionHandle as Binary