Fixes session variable not being cleared