add functions for executing commands on failure