Fixed wrong placement of new code + use strstr()