Fixed problem with logging out not redirecting to main page