improved interface checking code