added secure and authenticated checks and tests