message handling improved