fixed an issue with strcmp if result equal NULL