Fixed error throwing exception