fixed plotting error