try to autodetect configuration