Improved onCommand