added command validation