fix loop break
fix mktemp