Fixed an issue where code was executed incorrectly on the logout page