attempt to fix type instability