fixed weird code