run before save at a more logic place