added logger to view and controller function