fixed generate URL issues