added more preconditions