Added logger as an argument.