fixing some bugs from chaing to the new sesssion stuff