Fix issue TypeError: Not a string or buffer