class not working well at all. moved cruise function to main script file and is working well.