length check not working on template rollback