bug fix and added sessions