Fix NullPointerException in onCommand