fixed some a bug in jserver, added some debug lines