added flush method to queue wrapper