added option to write new toacache with pointer to the new skymap