Added progress bar updating, does not wark as it should.