fixed redirection issues among other things