a bug version before rewrite