made the catch block print errors