finish direct message function