Don't release the buffer too early
Only release 1 reference