adjusted to work with newest core plugin