Fixed the concurrent issue with task removing sql connections