added semicolons and fixed a throw