move this at the beginning of the controller