Fix krl script
Switch to monitor mode before changing strategy control mode
Define function to manipulate flag in krl script