adjusted for uncaught exception error