fixed potentially uninitialized ptr error

also deleted two line ending spaces