UK secures the rights of millions of EU citizens