added some html safety checks