made corresponding improvements in the instances_controller