Properly passing objects to view