change max procedure