add 'rename'&'remove' function and solve some bug about encoding