Adding extra check for cmd result