using automatic detect