fix mode0 and add mode1