fixed a bug in backend and a bug in front end