Added in better session management