Added logging and fixed progressbar