Limit number of registration attempts

Change-Id: Id43f066dc8cac539c7b100c6062b63fdc8a5f53f