implemented rules ui as non-modal. Some fixes