Fixing syntax error of missing end