Fix for indexOf issue