Added try catches everywhere