use region as input if possible