added better entity finding code
Signed-off-by: timothy <timothy@timothy-linux.(none)>