Added onCommand method