Fixed indentantion and how to handle errors.