Added check for ruletype