decreased count, added some try catches