added map difference
fixed the deletion of local variables