added lots of safety