Issues/2014 do not pass entity around

Closes #2014  

@sendhil it's on all of the sample code.  ;)