Fix issue #3, which is caused by incorrectly using of string search function