fixed some minor syntax issues with example js code