fixed exceptions and added test