fix broken function