L&L - Licensor deducting amount from the Security Deposit

Sir, I was in a Leave and License agreement for a duration of 11 months. The duration of the agreement was to complete on 30th July 2017. The Licensor did not want to continue with the agreement and wanted us to vacate the flat. We had a written communication (whatsapp) with the Licensor and informed him that we have found an alternate arrangement and we are willing to vacate the flat on 15th July. We Duly vacated the flat on the said exit date with all the terms and conditions imposed on us (like paying exit fees for using the lift by the society etc). Now when we are asking for the refund of our security deposit the licensor is bringing out trivial issues like there are lot of Nails on the walls, the Fan has not been cleaned etc, walls are dirty, there is seepage on the walls near the bathrooms (this is a common problem for all the flats in the society) I have agreed to undertake some of the grievances that he has put forward at my cost. Wanted to enquire if the licensor still does not refund the full amount what is the course of action that i can take