finish all function