cleanup and upload fixing
locking but no interface yet