PLA-509 add just a little bit more safety checks