removing duplicates in controller