ToDo: check why do we need resetting session variables