made changes to accomodate for api changes