fix possible problem in DetectFreeflying