add debug message handling to upload worker