Moved dist_init() to within controller()