fixed pointer errors