moved some try catchs around