So I thought I miscarried

I'm still bleeding but went to hospital I thought the worse they did an ultra sound vaginally and there it was still in there it's little heartbeat flickering and it sounded so strong I didn't know how to feel cause I thought I lost it but it's still there they said tho the bleeding came from behind the sac it wasn't bad but to increase my fluid intake but the baby is still alive and well and beating!