added logic to HTTPSServlet