Auto increment does not works properly