updated controller logic for application and company