bug fixed in rb_query in clear function