fix bug in autoplot