making sure corruption does not occur