wrong exception was raised
moved auto-init function