fixed site reference and simplified the code a bit