Bugfix for filesearch function