made sure db stuff ends up in the right place