Better error handling. Usig class variable.