database only write if score better