Changed way to close the message divs