The commandAction was simply calling the respective functions.
Instead, when I started a new thread for each case in commandAction and in that thread, called the respective function,
everything seems to be fine.
Thanks everybody for giving me this opportunity.
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss