fix error logging in init