Added code to pass data to views.