attachment bug fixed, javascripts fixed & improved