fix for getEntity and the return of a non-object