fixed some bugs, add inverted checkbox