some security improvements