Fixed getNextLoggableId function, also changed  the name to use lowercase "d"