updated to to new APIs