add autoconfig but need to be tested