Bug fix for deleting pins