fix return value when there is no error