check if return value is valid