Added onBarClick functionality