moved in code

moved site and query variables to top