added support for empty rules