fixed stupid mistake, extra 'end' line which caused syntax error.