fixed mining bug