fix bug in searching files