fixed duplicated output bug