modified to make releases
added ugly code (because order of DB options is not guaranteed)