add additional saftey checks