implemeting read_command_stream