A new method to measure the mass of galaxy clusters