implemented smart positioning of loading bars