sets empty pointers to null when creating a new node