Manage right on temp files
Fix some bug