Added barrier option.