corrected bug in mode 7