pointer error corrected