fixed buffer issue