fixed errors on plotting