pointer safety fix.