found and fixed a bug in serial number generator