Added more checks in onHealthChange and removed uneccesary stuff.