use middleware for revision