mask zIndex logic adjustment