Missing end fixed