fix bug when specifying region