Working example for getting entity