add region command and better error handling