Added var and missing semicolons