added code from auto test