Modified the logic of advertisement slot allocation