javascript fixed and some minor design changes