Automatically append closing curly brackets