Modal PtAskQuestion Problem

I have a strange situation here, I have a Timer, it runs every second, if
certain condition is met, it calls other functiion A to
process something. Everything works fine except when a PtAskQuestion()
modal dialog box rasied in a Button’s callback,
before that PtAskQuestion is destroyed by user selecting a choice, if the
Timer runs function A, my photon app

I commented out everything in function A, then it is fine

As soon as i put a line of code in function A, or declare a variable, it

can anyone give me hint on what’s going on? and how to fix it?