fix illegal invocation error when using log in chrome