Fixed a bug when concurrently calling
Before mering with casa's code