Added switch statement for void elements