I changed the code that it not to throw exception.