added saving usercode