fix return logic