added maxHealth check