Added the command check function to provent breakdown.