add logic of controller