adapted fpupload function to replicas