fixed bug with not rethrowing the exception