fix segmantaion fault in update_sdb()