Fixed bug caused by invalid ref to provinces var