Changed the instance detection