properly zero buffer