Removed unexpected </a> tag

Removed unexpected </a> tag and rearranged part of the code