close db... and modify close transfer socket