Just move finish : before the freeze_mode = 0; but after the bracket above