Update Database structure and bug fix