Added memory barrier