fix data missing in apply