added a check to verify if a statement is a callable() to make issues with wait_until easier to debug.