fixed adding integer to set, more error handling