added a logger to a functions