core.sql corrected