fix mine_functions