bug fixes for deleting rules