rewrite to allow downgrades