fixes to core logic