rework type check