removes trailing semicolons