fixed an issue with consecutive spaces with the find function