added refresh=true flag to flush cache