fixed problem with exceptions