updated to work with v2
updated to work with v2 API