a safer/better fix for #64