fixed pointer problem