fix log in constructor