fixed uncaught exception throwing when it shouldn't