Fixed bug with setting region automatically