fix #17
fix the duplicate problem when overwrite a file
fix the behavior of handling read only element