improve error handling when entity can't be resolved