Why is there showing an error for }