added logger as an optional param