Fixed issue with incorrectly redirecting user to dashboard from certain pages