fixed problem with pointers