Also make sure that one of your functions isn't creating entities in an endless loop.