Add saftey checks