added more try catches