fix syntax error in preinit hook (#6610)