seperated message sending from gui