fix html and logic error