fixed unnecessary buffer creation