fix the bug the it doesn't return a buffer when string is empty