added preconditions tests