proper way to do autodetection