fixed bugs in encryption detection