Changed order of printing error because error seemed related to previous command.