Added try to catch errors
Minor changes