Please disregard my message.
It was my fault.
Thank you again for such a great job!
For those who experience the same issue:
the $post variable is not available in ajax call so you need to pass page id to the statement trigger.
And the code below needs to be modified or disabled in statement trigger:
if (is_admin()){
return;
}
ajax calls go through wp-admin nothing will happen.