trying to make autoconfig more robust