fixed empty output bug