fix not a string or buffer error