fix validate and autodetect