security enhancements (closing #221)