Fixed to handle order of views in controller
Before this change, the definition order of views had been lost.
and the order of dispatching was random.