Duplicate fix

This fix the return value when the ID generated is already in DB.

Test using 1 lenght and "123456789" alphabet, now dont work, return null with this fix return the value.

Also remove empty spaces.