added relativePath to uploadAndRegister