Finally fixed js problems