Fix error: must be string or buffer, not file