added clamping for bars