created a new Exception layer to catch errors