fix bug in autobegin