fixed the insert flight function call