added autodetect plugin functionality