change ArrayBuffer to HashMap for DB