add error checks and by name lookups instead of by ip