fix issues with uploadtoserver, remove debug methods and code.