adding progress bar and fixing some little bugs