fixing overlay handling