update min and max keys