added thread-safe entity functions