The president and Pelosi worked together