fix bug with priority write