fix bug in core