Rewrite onCommand method