replace apply with call