Invert logic and fix html