added flag for background garbage collection