fixing overlay bug