Added handling for loading bar