Security and validation improved