Fixing funtion pointer error