error handling. sort of.