fix javascript bug to save course content correctly