added functions for cleaning specific elements of read and write queue
removed one check