fixed bug with auto mode