added behavior to the directive