make eval scripts failure-safe and add runtime-check for eval codes