fixed the bugs in find by condition