smarter marking as dirty