update  amount logic