Add take-until function