Add write function to loaders