database update and bug where first line was deleted