bugfix related to autoincrement