bug fix for copy task function - race condition rectified