fortified save function