added model and entity manager