some logic for money input