rewrite site function