Added optional while condition to jex.do()