added error catch for streaming