Fixing slave key logic