change type of __hash to hex-encoded string
fix bug. tmp file locates in wrong path