Update core.py

Bugfix