fix displayTip function issues