fix a bug in front end