Set mask before adding the proxy

If we call set_mask after setting the proxy, we will loose the information
already present there.

Change-Id: Ifb423d4e14d045a59554137ffd7b7752c6cccdde