Fixed Session handling so connection stays open.