Added clearQueue function