updated tooltip logic for proper placing