improve resursive locks detector