improve error handling
add domain limit checking