Added failure detection