Fixed problems with url redirection when user is not authenticated