fixed all databse errors after testing them