fix buffer return