adding warn and error functions. Also don't flush queue if in the process of flushing