sending data works properly with message type