adding logger and cleanup