html entity decode added and adding debug output for teacher check