fixed stream upload and added debug information