fix return code bug