fix return statement without value. return the error value