fix find_entry usage with error check