removed flush function