implement auto fix before save