move function for attaching message