adding more try's and better exception handling