Cost ptr bug fix