fixed bugs with localhost uploading