rewrite base controller again

this time search for the id of the target. If no target id is given
then search for the first parent.