fixed bug where exception was thrown without reason.