Fix mistake with the use of apply