trips javascript controller functionality