added progress bar and capped file size