fix getdata in plots function