Fix variable name

- s/resource/entity/ on line 397; reported by @ralphschindler