Added epoca stop condition