added classes to header and footer of legened
fixed reserved word bug