Changes to make entity work