better exception handling and old school exception handler