Use custome error class and remove indentation issues.