fixed bug with auto increment