added cleanup for read messages