Replaced all errors with custom errors