avoid zero division error
Merge pull request #6 from makiuchi-d/avoid-zero-division

avoid zero division error
avoid unbound local error
Merge pull request #7 from makiuchi-d/init-response

avoid unbound local error