Updated invalid command handling