use select to handle new message