return immediately when condition is met