spice function fix