bug fixes with checking sessionid