fixed a bug when the streams list was empty the program crashed