solving serious bug with creating session object