pointer dereference bug fixed