add tests and fix log to console feature