function to show/hide progressBar