adjusted to api change