also made rest conditional on unit being provided, previouslly it changed from being always required fixes #23810 alternate to #23907