script adapted to new skin
some bugs fixed in template