fixed instance type detection