better error message in units