better overlay handling