Fix function order