made uploads robust