reorder: add checks for invalid function inputs