fix isontop condition