add validateSync and small improvements