third attempt to fix #1023
squash npe