added dirty tracking