Removed broken code
Changed how errors are handled