fixed mang bugs