fixed some javascript issues