Updated except statements to only catch necessary exceptions