added last_insert_id to database class