updated to follow new autodetect callback sig