When try to switch from custom mode to any another mode, mode changes but drone crashes

mode_arucoland.cpp (3.2 KB)
This the cpp file attached , this is my custom mode that i am working , but when i try to switch from this custom mode to any another mode , mode changes to that mode but altitude decreases and drone crashes. please help me to solve this problem. i am using copter version 4.4.0 beta 5 .

Start by rebasing your changes onto ArduCopter 4.4.3 or even better, ArduCopter 4.4.4-beta1

After that re-test and post .bin dataflash log files.

i have tried in copter version 4.4.3 but still drone crashes. https://drive.google.com/file/d/1_sgXIc7TdksaSL9DWBiuXyqR8kvc6itL/view?usp=drivesdk this is link for the .bin dataflash log for the drone crash.