Avoided session loss if user reloads page