Fix calling function before declaration