Bugfix sites script
update and fixes for sites script