cast to ensure error message prints properly