add preparation logic
progress bar added
bug fix