Refactored & fixed health check code 

Fix: negation operator was bind to string instead of indexOf result.