add support for progress function