fixed recalculate_button handler