fixed bug in matching files not dirs