fix bugs of using find function