adding sample app's logic to reproduce the issue