fixed bugs with sudo upload