fixed comparison of updated values