convert setTimeout to Calendar\.nextTick when file has been loaded