fixed some javascript events