Fix for redirection and appcontroller