Fix ruby syntax error due to an extra end