avoid infinite loop problem

- Fix #1

Signed-off-by: Hiroshi Miura <miurahr@linux.com>