added failure handling functions