some minor changes to controller