second attempt to fix #40