wait should accept a statement to check for a boolean result