session simple implementation and bug fixes