fixes rebuild database