moved the ids controller code to the right place.