In most cases, the rules about returning a security deposit are included in the terms of the agreement. Check the contract details for what kind of agreement it was with regard to the handling of the security deposit upon departure. If you did not get the deposit back and the contract says that you are supposed to get it back, confirm the reason why.