set flag on alarm function