updated command implementation in lib/stream