inspired by f5e48a3, a seems to work to fix 1076