added circular reference error check.
if same user creates new revision, trash old one automatically.
added missing dependencies in example