fixed redirection problems