stop iteration when false is returned