added handling of statements before match in select loop.