Move delete function to worker