added write_secure_token() method