Further logic changes in controller