added logger and matrix exception