fix to handle substring matching by filter function