change message structure to have more type checking
tests fixed + small addition
fix chat