Error implementing apply with null