Tmi 26weeks pregnant

Deana
TMI***
I'm 26+1 pregnant and experiencing brown moucus discharge. I was in hospital three days ago as midwife thought my waters went as I was having a lot of watery clear discharge but all was ok they don't a internal exam do you think this has caused the brown discharge ? I did also have sex last night I didn't "finish" & lasted about 5mins. But could this of caused it as well? It's my first don't know what to expect ??