add some example code for getting entity