fix an return error issue and update GUI