fix return codes

the return codes were set incorrectly