fixed bug in barrier construction