added support for dirty checking