Fixed a critical bug which may affect detection caused by typo. Thanks a lot @thomasareed