modified getParameter function