fixed detect after trying forked version, which is slower