added auto mode