wrap in IF and remove dodgy </ from the end