fixed bug in constant time compare