support priority, close #6; fix #8;