Update agency-portal with copy command and better error handling