update whenever, and fixed numbering function releated to nil problem.