fix bug in bar