Added a function to set the width of bar from the public