finally found the way to throw exceptions, but it is getting late so return to this another time