added route function to chat