showing progress bar at appropriate time