fixed bug in find functions