fixed some bugs in viewservice