Fixed dereferencing pointer error