added additional safety measures