fixed reading of multiple commands