added auto close to message component