NOT WORKING added check for session var to keep track of subdomain