Add overlay handling code