fixing uploadAndRegister