fixes
use for inner functions
indexes for entity