Fixed catastrophic pointer error