Clear database
Fixed for loop