add save function to links