Security deposit refund

I returned the security deposit to tenant by deducting pending month electricity bill estimated charges( that were unknown at the time of vacating) and also for other damages and untidiness in the flat. All total I deducted 15% of deposit which includes electricty bill as well. Now after 40 days of refund he has come back saying actual electricity has come low than the deducted cost and also he is not acceptable of damage and uncleaniness charges and threatening to refund every penny. While refunding the amount I sent these details in email with refund transaction id explaining him the charges. In real, it costed me more than a month’s rent to repair and clean up the flat in the same condition what I gave him. I newly painted the whole flat when renting it out to him and in just 18 months he has damage all the paint and walls turned charcoal gray. Also he damaged the appliances like purifier, ceiling lights, gas stove, bathroom bath tub showers etc which i didnt mention in the refund settlement email. He has sending me threat messages. What should I do? How can I prepare before hand in case he sends me notice or something else? He is not resident of the same city/state where my property is.