fix some bugs in connection with frontend