Fixes logging out after logging in without page reload