fixed a bug w.r.t file permissions