add def to controller