Added barriers correctly