Fixing the size bar, increased code robustness to errors