fix autodetection