Handle incoming commands