improve return codes