Added method to pass data to the view from the controller