corrected flush function and related specs