add instance type check