Ensure writing of rmodules to response is in correct order