Fix mysql procedure