fix MAX_VERSION bug