Adding a barrier to avoid a possible case of memory being freed before
operation completes