fixes bug with session handler