Fixed a little bug with the CSS Transition overlapping with the JavaScript