changed error management. avoid doing it by get