save the $("#messages") as a reference and reuse it