fixing last_insert_id mess