add Preconditions checks