updated with new apply