fixed incorrect use of API