corrected writing to make it work with any id (not successiv).