auto detecting instances