Fix Cannot call method 'getAllLogs' of undefined

Attempt to fix #1981