fixing errors, closer to getting sessions working