fix type casting in escape