modified vfs-write