Fixed wrong exception thrown in text