buffer resize fix