Fix flip card functionality