removed the $element dependency from controller.