enable "display_errors" depending on the environment
"simplified" the logic related to contract terminations