fix database and validation