autodetection working