Fixing bug when session was too lenghty