fix bug in calculate when input amout is empty