remove unused variables, fix if progress is set to false