fixed bug in auto