Fix bug and database