Fixed error using new API