Fixed bug caused by api change