correct a bug in frontend code