improve error handling for invalid commands for migrate