Deductions & credits

As long as it was eligible when you purchased it is all that matters. Nothing says you lose the benefit if you sell