added write inode method