added duration control