fixed an edge case in which we would have triggered a race condition

accessing the internal input buffer while it was used by a callback