added filter directive, took it out of the controller