fix a bug in core
fix a bug when compiling