lab 2 bugfix on flushPage