Fixed wrong exception message and removed unnecessary method.