Clean up permalink save function