Fixed a bug for ViewCommand.