Updated to work with current API