added flags, link and db